//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#ifndef _PTGENERICVIEW_H
#define _PTGENERICVIEW_H
//
#include <QObject>
#include "objectview.h"
//
class QCheckBox;
class QComboBox;
class QLineEdit;
class QPushButton;
class QSpinBox;
class QToolButton;
class RandomDoubleWidget;
class PTGenericView:public QObject,public ParticleTemplateView
{
   Q_OBJECT
   Q_DISABLE_COPY(PTGenericView)
//construction
public:
   PTGenericView(QObject *p_parent=0);
   ~PTGenericView();
//slots
protected slots:
   void on_visible_check_clicked();
   void on_life_time_value_changed();
   void on_density_edit_editing_finished();
   void on_gravitation_check_clicked();
   void on_friction_check_clicked();
   void on_shape_combo_current_index_changed(int p_i);
   void on_texture_edit_editing_finished();
   void on_texture_browse_button_clicked();
   void on_tile_s_value_changed(int p_value);
   void on_tile_t_value_changed(int p_value);
   void on_num_tiles_edit_editing_finished();
   void on_tile_speed_mode_combo_current_index_changed(int p_i);
//ParticleTemplateView
protected:
   void handle_object_changed(model::ParticleTemplate *p_old_object);
   void handle_post_primitive(const Primitive &p_prim);
//widgets
public:
   QWidget *get_visible_widget() const;
   QWidget *get_life_time_widget() const;
   QWidget *get_density_widget() const;
   QWidget *get_gravitation_enabled_widget() const;
   QWidget *get_friction_enabled_widget() const;
   QWidget *get_shape_widget() const;
   QWidget *get_texture_file_widget() const;
   QWidget *get_tile_s_widget() const;
   QWidget *get_tile_t_widget() const;
   QWidget *get_num_tiles_widget() const;
   QWidget *get_tile_speed_mode_widget() const;
//implementation
private:
   QPushButton *visible_check;
   RandomDoubleWidget *life_time_widget;
   QLineEdit *density_edit;
   QCheckBox *gravitation_check;
   QCheckBox *friction_check;
   QComboBox *shape_combo;
   QLineEdit *texture_edit;
   QToolButton *texture_browse_button;
   QWidget *texture_widget;
   QSpinBox *tile_s_spin;
   QSpinBox *tile_t_spin;
   QLineEdit *num_tiles_edit;
   QComboBox *tile_speed_mode_combo;
   void update_pt_texture_file(const QString &file_name);
   void block_edit_signals(bool p_block);
};
//
#endif
